%h2
  =_ "medias"
  = image_tag "indicator_arrows.gif",:id=>"busy_media",:style=>"display:none;"
= "<br>"
%table{:style=>"border:1px solid;padding:0px;margin:0px;"}
  %tr
    %td
      %b=_ "Title"
    %td
      %b=_ "Creation"
    %td
      %b=_ "Published"
    %td
      %b=_ "Category"
    %td
      %b=_ "Author"
    %td
      %b=_ "Comments"
    %td
      %b=_ "Expires"
    %td
    %td
  - for @media in @medias 
    %tr{:id=>"tr"+@media.id.to_s}
      %td= link_to HTMLEntities.decode_entities(@media.title), "/"+@media.permalink
      %td= @media.creation.strftime("%d/%m/%Y %H:%M")
      %td
        - if @media.published==1
          = _("yes")
        - else  
          = _("no")
      %td= link_to @media.category.name, "/media/category/"+@media.category.name 
      %td= @media.user.login 
      %td= @media.comments.size 
      %td
        - if @media.expires==0 
          = _("no")
        -else
          = _("yes")
      %td= button_to _("edit"), :action=>"edit",:id=>@media 
      %td= link_to_remote image_tag("cancel.png",:style=>"border:0px;"), :url=>{ :action => 'destroy', :id => @media.id }, :confirm => _("Delete post and all associated comments?") , :loading =>"Element.show('busy_media')",:complete=>"new Effect.Fade('tr#{@media.id}');Element.hide('busy_media')" 
= "<br />"
= will_paginate @medias
= "<br />"

